General
The following conditions and actions are applicable to all general entities. Return to FPI Scripting. CONDITIONS ACTIVATED=X Description: Is true when the activation value of the entity is equal to X. Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :activated=1:state=1 ALPHAFADEEQUAL=X Description: Is true when the alpha fade/tranparency value of the entity equals X. Range: X = 0 to 100 Example: :alphafadeequal=0:destroy ALWAYS Description: Is permanently true. Example: :always:shootplr ANYFURTHER=X Description: Is true when any entity is further away than X units (100 units = 1 segment). Range: X 0 to 540,000 (maximum distance in level) Example: :anyfurther=200:decalphade=100 ANYWITHIN=X Description: Is true when any entity is within X units (100 units = 1 segment). Range: X > 0. Example: :anywithin=50:activateifused CANTAKE Description: Is true if the entity can be taken by the player. Example: :cantake:playertake NEVER Description: Is never true. Example: :never:destroy QUANTITY=X Description: Is true when the number of ammo clips currently carried by the entity equals X. Range: X = 0 to any value. Example: :quantity=1:state=1 RANDOM=X Description: Is true when a random number between 0 and X equals 0. I.e. random=1 gives a 50% chance of being true, whereas random=100 gives a 1% chance of being true. Range: X = 1 to anything, although setting above 1,000 will make this conditions very unlikely to be true. Example: :random=1:incstate SHADERVARIABLE=X Description: Is true when the FX shader variable for the entity is set to X. This condition is not officially supported or documented and is only available for experimental use only. Range: X = 1 to unknown. Example: :shadervariable=1:state=1 SHADERVARIABLEGREATER=X Description: Is true when the FX shader variable for the entity is greater than X. This condition is not officially supported or documented and is only available for experimental use only. Range: X = 0 to unknown. Example: :shadervariablegreater=1:state=1 SHADERVARIABLELESS=X Description: Is true when the FX shader variable for the entity is less than X. This condition is not officially supported or documented and is only available for experimental use only. Range: X = 0 to unknown. Example: :shadervariableless=1:state=1 STATE=X Description: Is true when the FPI state is equal to X Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :state=0:shootplr UNDERWATER=X Description: Is true in the following conditions: · When the entity is under the water and X=1. · When the entity is above the water and X=0 Example: :underwater:explode ACTIONS ACTIVATE=X Description: Sets the activation value of the entity to X. Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :state=0:activate=1 A''CTIVATEIFUSED=X Description: Activates the entity nominated in the entity’s “If Used” field and sets the activated entity’s activation value to X. '''Range': X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :state=0:activateifused=1 ACTIVATEIFUSEDNEAR=X Description: Activates the entity nominated in the entity’s “If Used” field IF THE “If Used” entity is within 80 units (100 units = 1 segment) and sets the activated entity’s activation value to X. Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :state=0:activateifusednear=1 ACTIVATETARGET=X Description: Activates the entity’s target entity and sets the activated entity’s activation value to X. Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :state=0:activatetarget=1 ALTTEXTURE=X Description: Switches the texture of the entity as defined during the level editor. Range: X = 0 normal texture X = 1 alternative texture Example: :state=0:alttexture=1 CARRYALL Description: This actions is design to be used by Lifts and allows the lift entity to carry all entities within the segment it occupies. Collision is switched OFF for the lift entity and the carried entities when this is called. Example: :state=0:carryall COLOFF Description: Disables collision detection for the entity. Example: :state=0:coloff COLON Description: Enables collision detection for the entity. Example: :state=0:colon DECALPHAFADE=X Description: This decreases the alpha fade/transparency value of the entity. X is defined as the target alpha fade value. Range: X = 0 to 100 Example: :state=0:decalphafade=0 DECSHADERVARIABLE=X Description: This action decreases the shader variable by X. This action is not officially supported or documented and is only available for experimental use only. Range: X = 0 to ? Example: :state=0:decshadervariable=1 DESTROY Description: This destroys the entity and removes it from the level. If re-spawn parameters have been set, these are now triggered. Example: :state=0:destroy EXPLODE Description: This causes the entity to explode allowing it to cause damage. It does not destroy the entity. Example: :state=0:explode FLOATRATE=X Description: This defines the height to which the entity floats. This action will cause the entity to oscillate up and down from its original position to a height of 2X units. The rate oscillation can not be changed using script commands. Range: X = 0 to 2,000 (above 2,000 is possible, but this places entity over 20 segments high). Example: :state=0:floatrate=1 FLOORLOGIC Description: Prevents entity from leaving y (up-down) position. Example: :state=0:floorlogic HIDESHADOW=X Description: This switches the entity’s shadow parameter ON or OFF Range: X = 0 – Switch shadow ON, X = 1 – Switch shadow OFF. Example: :state=1:hideshadow=1 INCALPHAFADE=X Description: This increases the alpha fade/transparency value of the entity. X is defined as the target alpha fade value. Range: X = 0 to 100 Example: :state=0:incalphafade=100 INCSHADERVARIABLE=X Description: This action increases the shader variable by X. This action is not officially supported or documented and is only available for experimental use only. Range: X = 0 to unknown. Example: :state=0:incshadervariable=1 INCSTATE=X Description: This increases the state value of the FPI by X. Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :random=1:incstate=1 ISALTAMMO Description: This sets the ammo entity to provide alternative fire ammo. Example: :state=1:isaltammo NOBULLETCOL Description: This switches the bullet collision for the entity OFF. Example: :state=1:nobulletcol NONE Description: This performs no action. Example: :state=0:none NOGRAVITY Description: This switches off the effect of gravity on the entity. Example: :state=0:nogravity ROTATEIY=X Description: This sets the entity to rotate around it’s Y-axis by an increment of X degrees. For example, if the entity is already rotated 45° about the Y-axis, using rotateiy=45 will rotate the entity to 90°. If the entity is set to always active, the rotation will be smooth. If the entity is not set to always active, the rotation will only be smooth if the player is close to the entity. Range: X = -360 to 360 (larger angles can be used, but are not necessary) Example: :state=0:rotateiy=180 RUNDECAL=X Description: Sets the decal mode for the entity to X. If particles are disabled, the decal mode is set to 2. Range: X = 0 to ??? Example: :state=1:rundecal=1 RUNFPI=FilePath Description: Starts and runs a new *.fpi defined by X. The child.fpi runs in place of the parent.fpi, not in parallel. To return to the parent.fpi, the parent.fpi must be called by the child.fpi using “runfpi=” Range: FilePath = File path to new *.fpi. Example: :state=10:runfpi=MyGameScripts/shoot.fpi RUNFPIDEFAULT=X Description: This stars and runs a new *.fpi as defined in the APPEAR, MAIN, DESTROY and SHOOT fields in the entity properties deinfed in the level editor. The new.fpi runs in place of the old.fpi, not in parallel. To return to the old.fpi, the “runfpidefaul=” actions must be called stating the correct value for X. Range: X = 0 – run appear script, X = 1 – run main script, X = 2 – run destroy script, X = 3 – run shoot script Example: :state=0:runfpidefault=1 SELECTSHADERVARIABLE=X Description: This action selects the shader variable. This action is not officially supported or documented and is only available for experimental use only. Range: X = 0 to unknown. Example: :state=0:selectshadervariable=1 SETALPHAFADE=X Description: This sets the alpha fade/transparency property of the entity to X. Range: X = 0 to 100 Example: :state=0:setalphafade=100 SETIFUSED=EntityName Description: This sets the entity’s “If Used” parameter to X. Range: EntityName = Name of entity to activate if used. Example: :state=0:setifused=ExplodingBarrel SETSHADERVARIABLE=X Description: This action sets the selected shader variable to X. This action is not officially supported or documented and is only available for experimental use only. Range: X = 0 to unknown. Example: :state=0:setshadervariable=1 SETTARGET Description: This sets the entity’s possible target to its actual target. Example: :state=0:settarget SETTARGETNAME=EntityName Description: This sets the entity’s target to X. Range: EntityName = Target entity’s name Example: :state=0:settargetname=EmptyBox SETUSEKEY=EntityName Description: This sets the entity’s “Use Key” parameter to X. Range: EntityName = Key name Example: :state=0:settusekey=BigRustyKey SHAPEDECAL=X Description: This changes the decal mode of the entity to X. Range: X = 0 to max value? Example: :state=0:shapedecal SPAWNOFF Description: This sets the entity’s “Spawn at Start” parameter to NO. Example: :state=0:spawnoff SPAWNON Description: This sets the entity’s “Spawn at Start” parameter to YES. Example: :state=0:spawnon SPINRATE=X Description: This sets the entity’s spin rate to X. Range: X = 0 to any value, although setting higher than current FPS makes the entity appear strange. Example: :state=0:spinrate=1 STATE=X Description: This sets the FPI state value to X. Range: X = 0 to 100,000,000 (above 100,000,000 causes variable problems) Example: :state=0:state=1 Return to FPI Scripting.